package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HsSubMapper;
import com.ruoyi.system.domain.HsSub;
import com.ruoyi.system.service.IHsSubService;

/**
 * 求助者需求提交Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-11
 */
@Service
public class HsSubServiceImpl implements IHsSubService 
{
    @Autowired
    private HsSubMapper hsSubMapper;

    /**
     * 查询求助者需求提交
     * 
     * @param id 求助者需求提交主键
     * @return 求助者需求提交
     */
    @Override
    public HsSub selectHsSubById(Long id)
    {
        return hsSubMapper.selectHsSubById(id);
    }

    /**
     * 查询求助者需求提交列表
     * 
     * @param hsSub 求助者需求提交
     * @return 求助者需求提交
     */
    @Override
    public List<HsSub> selectHsSubList(HsSub hsSub)
    {
        return hsSubMapper.selectHsSubList(hsSub);
    }

    /**
     * 新增求助者需求提交
     * 
     * @param hsSub 求助者需求提交
     * @return 结果
     */
    @Override
    public int insertHsSub(HsSub hsSub)
    {
        hsSub.setCreateTime(DateUtils.getNowDate());
        return hsSubMapper.insertHsSub(hsSub);
    }

    /**
     * 修改求助者需求提交
     * 
     * @param hsSub 求助者需求提交
     * @return 结果
     */
    @Override
    public int updateHsSub(HsSub hsSub)
    {
        hsSub.setUpdateTime(DateUtils.getNowDate());
        return hsSubMapper.updateHsSub(hsSub);
    }

    /**
     * 批量删除求助者需求提交
     * 
     * @param ids 需要删除的求助者需求提交主键
     * @return 结果
     */
    @Override
    public int deleteHsSubByIds(Long[] ids)
    {
        return hsSubMapper.deleteHsSubByIds(ids);
    }

    /**
     * 删除求助者需求提交信息
     * 
     * @param id 求助者需求提交主键
     * @return 结果
     */
    @Override
    public int deleteHsSubById(Long id)
    {
        return hsSubMapper.deleteHsSubById(id);
    }
}
